﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Frontend.Master" Inherits="System.Web.Mvc.ViewPage<IPagedList<sp_GetPartnerResult>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Danh mục
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%= Html.Hidden("URLBack", (string)ViewData["LinkBack"])%>
    <div>
        <% Html.RenderPartial("Modules/Mod_Client"); %>
    </div>
    <div class="ccat">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td class="ccat-lft">
                    <div class="cat-header">
                        <span>Danh mục</span>
                    </div>
                    <% Html.RenderPartial("Modules/Mod_SubMenu"); %>
                    <% Html.RenderPartial("Modules/Mod_AdvertisingLeft"); %>
                </td>
                <td class="ccat-rgh">
                    <div class="ccat-breadcrumb">
                        <%= (string)ViewData["NavigationLink"]%>
                    </div>
                    <div class="hcat">
                        <div class="hcat-partner" id="pProductList">
                            <% Html.RenderPartial("List", this.Model);  %>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        function beginPaging(args) {
        }

        function successPaging() {
        }

        function failurePaging() {
            alert("Could not retrieve products.");
        }

        function filter() {
            JS_LIB.setFilter($("#txtKeyword").val(), $("#ProvinceList").val(), $("#DistrictList").val(), $("#URLBack").val());
        }

        $(document).ready(function () {
            JS_LIB.onEnterKeyword();
            $("#ProvinceList").change(function () {
                var provinceID = $("#ProvinceList").val();
                $("#DistrictList").html("");
                $("#DistrictList").append($("<option value=''><%= Constants.CATEGORY_FIRST_DISTRICT %></option>"));
                if (provinceID != 0) {
                    $.getJSON('/Library/GenericHandle/DropdownListHandler.ashx?ID=' + provinceID + '&Page=District', function (item) {
                        $.each(item, function () {
                            $("#DistrictList").append($("<option value='" + this['ID'] + "'>" + this['Name'] + "</option>"));
                        });
                    });
                }
            });


        });
    </script>
</asp:Content>
